package com.example.shop_2304.adapter

import android.graphics.Color
import com.alibaba.android.arouter.launcher.ARouter
import com.blankj.utilcode.util.ToastUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.entity.Child
import com.example.shop_2304.R
import com.example.shop_2304.utils.GlideUtils

class TwoCateChildAdapter:BaseQuickAdapter<Child,BaseViewHolder>(R.layout.item_twocate_rv) {

    override fun convert(holder: BaseViewHolder, item: Child) {
        holder.setText(R.id.child_tv,item.name)
        GlideUtils.loadImage(context,item.extra,holder.getView(R.id.child_iv))

        holder.itemView.setOnClickListener {
            ToastUtils.showLong("点击的分类id是${item.id}名称是${item.name}" )
            ARouter.getInstance().build("/app/SearchActivity").withInt("cid",item.id).withString("cname",item.name).navigation()
        }
    }
}